﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="outbox.aspx.cs" Inherits="Basic_outbox" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>发件箱</title>
    <link rel="stylesheet" type="text/css" href="../CSS/Style.css"/>
   <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script> 
  <script type="text/javascript">
  function check(){
  var num=$("input:checked").length;
  if(num==0){
    alert("您未选择任何消息！");
    return false;}
  else
    return true;
  }
  </script> 
  <style type="text/css">
  h2{
  margin-top:-38px;
  padding-left:90px;
  color:#77ac98;
  }
  .mail_pack{
     padding-left:20px;
     padding-right:20px;
     padding-bottom:10px;
      padding-top:10px;
  }
  </style> 
</head>
<body>
    <form id="form1" runat="server">
   <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div class="mail_pack">
          <div><img src="../Images/outbox.png" alt="发件箱" /><h2>发件箱
          </h2></div> 
    </div>
   <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
               <div style="background: #FFFCC9;border: 1px solid #FFD667;">
                  <div style=" float:left; width:50%"><img id="warning"  src="../Images/Warning.png" alt="提示" />邮件删除后将入垃圾箱，以防您误删！</div>
                  <div style=" text-align:right;"><asp:Button ID="Button1" runat="server" Text="删除" OnClick="Button1_Click" OnClientClick="return check();" />
                      <asp:DropDownList ID="ddlType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
                          <asp:ListItem Value="0">全部</asp:ListItem>
                          <asp:ListItem Value="1">普通邮件</asp:ListItem>
                          <asp:ListItem Value="2">学院邮件</asp:ListItem>
                          <asp:ListItem Value="3">项目邮件</asp:ListItem>
                          <asp:ListItem Value="4">系统邮件</asp:ListItem>
                      </asp:DropDownList>&nbsp;
                  </div></div> 
                <asp:GridView ID="GridView1" runat="server" CssClass="gvStyle" AlternatingRowStyle-CssClass="alt" 
                PagerStyle-CssClass="pgr" AutoGenerateColumns="False" 
                Width="100%" Font-Bold="False" EmptyDataText="暂时没有消息！" 
                EnableTheming="False" 
                DataKeyNames="id">
                    <Columns>
                        <asp:TemplateField>
                              <HeaderTemplate>
                               <asp:CheckBox ID="CheckBox_All" runat="server" Text="" AutoPostBack="true" OnCheckedChanged="CheckAll" />
                             </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="ItemBox" runat="server" />
                            </ItemTemplate>
                            <HeaderStyle Width="25px" />
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="收件人">
                            <HeaderStyle Width="100px" />
                            <ItemTemplate>
                                <%#Eval("name2")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="消息标题">
                        <ItemTemplate>
                                <%#strTitle(Convert.ToString(Eval("id")), Convert.ToString(Eval("title")))%>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="邮件类型">
                            <HeaderStyle Width="100px" />
                            <ItemTemplate>
                                <%#strType(Convert.ToString(Eval("type")))%>
                            </ItemTemplate> 
                        </asp:TemplateField>
                        <asp:BoundField DataField="createdate" HeaderText="日期时间" ReadOnly="True" >
                            <HeaderStyle Width="150px" />
                        </asp:BoundField>
                    </Columns>
                         <PagerStyle CssClass="pgr" />
                     <AlternatingRowStyle CssClass="alt" />
                </asp:GridView>
                <webdiyer:aspnetpager id="AspNetPager1" runat="server"
                        HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页" 
                        PageIndexBoxType="TextBox" PageSize="15" PrevPageText="上一页" ShowCustomInfoSection="Left"
                        ShowPageIndexBox="Always" Width="100%" CustomInfoHTML="共<font color=blue><b>%RecordCount%</b></font>条消息 每页：<font color=blue><b>%PageSize%</b></font> 条 共<font color=blue><b>%PageCount%</b></font>页 当前页：<font color=red><b>%CurrentPageIndex%/%PageCount%</b></font>" OnPageChanged="AspNetPager1_PageChanged" CustomInfoSectionWidth="50%" FirstPageText="首页" AlwaysShow="True" CustomInfoTextAlign="Left">
                </webdiyer:aspnetpager>
            </ContentTemplate>
        </asp:UpdatePanel></div>  
    </form>
</body>
</html>
